//
//  LoginViewController.m
//  DaFangYa
//
//  Created by design on 15/7/30.
//  Copyright (c) 2015年 HFKJ_LZQ. All rights reserved.
//

#import "LoginViewController.h"
#import "RegisterViewController.h"
#import "ForgetPasswdViewController.h"
#import <ShareSDK/ShareSDK.h>
#import <ShareSDKExtension/SSEThirdPartyLoginHelper.h>
@interface LoginViewController ()<UITextFieldDelegate>

@end

@implementation LoginViewController

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}
- (void)viewDidLoad {
//    self.titleForNav = @"登录";
    self.isSupportSingleTapHideKeyboard = YES;
    [super viewDidLoad];
//    [self setNavLeftItemWith:@"" andImage:[UIImage imageNamed:@"dissMissWhite"]];
//    UIButton *disMissBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 15, 60, 40)];
//    [disMissBtn setImage:[UIImage imageNamed:@"dissMissWhite"] forState:UIControlStateNormal];
//    disMissBtn.tag = 103;
//    [disMissBtn addTarget:self action:@selector(btnClickedHandle:) forControlEvents:UIControlEventTouchUpInside];
    _loginBtn.layer.cornerRadius = 2.0f;
    _loginBtn.layer.masksToBounds = YES;
    
    
//    UIImage *tempImage = [UIColor imageFromColor:CGRectMake(0, 0,DeviceWidth, 64) andColor:[UIColor clearColor]];
//
//    UINavigationBar *bar = self.navigationController.navigationBar;
//    [bar setTitleTextAttributes:@{
//                                  NSForegroundColorAttributeName :[UIColor whiteColor]
//                                  }];
//    [bar setBackgroundImage:tempImage forBarMetrics:UIBarMetricsDefault];
//    [bar setBackgroundImage:tempImage forBarMetrics:UIBarMetricsCompact];
    
    
    
    
    
//    bar.alpha =0.0;
//    self.extendedLayoutIncludesOpaqueBars = YES;
    
//    UIButton *normalBtn = [[UIButton alloc] initWithFrame:CGRectMake(DeviceWidth/2-70, 250, 70, 40)];
//    [normalBtn setTitle:@"没有账号?" forState:UIControlStateNormal];
//    normalBtn.titleLabel.font = themeFont15;
//    [normalBtn setTitleColor:kDefaultWhiteColor forState:UIControlStateNormal];
//    normalBtn.userInteractionEnabled = NO;
//    UIButton *registerBtn = [[UIButton alloc] initWithFrame:CGRectMake(DeviceWidth/2+5, 250, 60, 40)];
//    registerBtn.titleLabel.font = themeFont15;
//    [registerBtn setTitle:@"免费注册" forState:UIControlStateNormal];
//    [registerBtn setTitleColor:[UIColor yellowColor] forState:UIControlStateNormal];
//    registerBtn.tag = 100;
//    [registerBtn addTarget:self action:@selector(btnClickedHandle:) forControlEvents:UIControlEventTouchUpInside];
//    UIBarButtonItem *collect = [[UIBarButtonItem alloc] initWithCustomView:normalBtn];
//    UIBarButtonItem *share = [[UIBarButtonItem alloc] initWithCustomView:registerBtn];
//    self.navigationItem.rightBarButtonItems = @[share,collect];
//    
//    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];//去掉导航条下面默认的黑线条
//    self.navigationController.navigationBar.translucent = YES;
//    [self.navigationController setNavigationBarHidden:YES animated:NO];
//    [self.view addSubview:disMissBtn];
//    [self.view addSubview:normalBtn];
//    [self.view addSubview:registerBtn];
    _phoneTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
    _passwdTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
    
    NSUserDefaults *sd = [NSUserDefaults standardUserDefaults];
    NSString *oldPhone = [sd objectForKey:kuserAccount];
    _phoneTextField.text = oldPhone;
    [self setSubviews];
}

/*
 @property (weak, nonatomic) IBOutlet UIScrollView *scrollview;
 @property (weak, nonatomic) IBOutlet UIView *bigView;
 @property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
 @property (weak, nonatomic) IBOutlet UIButton *backBtn;
 @property (weak, nonatomic) IBOutlet UIView *inputPhoneView;
 
 @property (weak, nonatomic) IBOutlet UITextField *phoneTextField;
 @property (weak, nonatomic) IBOutlet UIImageView *phoneXianImageView;
 
 
 @property (weak, nonatomic) IBOutlet UIView *inputPasswdView;
 @property (weak, nonatomic) IBOutlet UITextField *passwdTextField;
 @property (weak, nonatomic) IBOutlet UIImageView *passwdXianImageView;
 @property (weak, nonatomic) IBOutlet UIButton *registerBtn;
 @property (weak, nonatomic) IBOutlet UIButton *loginBtn;
 
 @property (weak, nonatomic) IBOutlet UIButton *forgetPasswdBtn;
 @property(strong, nonatomic)loginCallBackBlock block;
 
 @property (weak, nonatomic) IBOutlet UIView *thirdLoginUpView;
 @property (weak, nonatomic) IBOutlet UIImageView *thirdUpLeftXian;
 @property (weak, nonatomic) IBOutlet UILabel *thirdUpCenterLabel;
 @property (weak, nonatomic) IBOutlet UIImageView *thirdUpRightXian;
 @property (weak, nonatomic) IBOutlet UIView *thirdLoginView;
 @property (weak, nonatomic) IBOutlet UIButton *wxBtn;
 @property (weak, nonatomic) IBOutlet UIButton *qqBtn;
 @property (weak, nonatomic) IBOutlet UIButton *wbBtn;
 
 */

-(void)setSubviews
{
    //根据不同的屏幕布局一下
    _scrollview.frame = CGRectMake(0, 0, DeviceWidth, DeviceHeight);
    _scrollview.contentSize = CGSizeMake(DeviceWidth, DeviceHeight);
    if ([UIDevice currentDevice].isIphone4) {
        _scrollview.contentSize = CGSizeMake(DeviceWidth, 568);
    }
    CGFloat totalHeight = _scrollview.contentSize.height;
    _bigView.frame = CGRectMake(0, 0, DeviceWidth, totalHeight);
    UIEdgeInsets paddingInsets = UIEdgeInsetsMake(0,0,0,0);
    [_bgImageView mas_makeConstraints:^(MASConstraintMaker *make){
        make.edges.equalTo(_bigView).insets(paddingInsets);
    
    }];
    CGFloat startHeight;
    CGFloat inputViewHeight =60; //kScaleFrom_iphone6_Desgin(60);
    CGFloat butonHeight = 45;
    if ([UIDevice currentDevice].isIphone4 || [UIDevice currentDevice].isIphone5) {
        startHeight = 150;
        butonHeight = 40;
    }
    else if ([UIDevice currentDevice].isIphone6)
    {
        startHeight = 200;
        butonHeight = 45;
    }
    else
    {
        startHeight = 240;
        butonHeight = 45;
    }
    _inputPhoneView.frame = CGRectMake(30, startHeight, DeviceWidth-60, inputViewHeight);
    //子view里面的布局
    _phoneXianImageView.frame = CGRectMake(0, inputViewHeight-1, DeviceWidth-60,1);
    CGRect phoneFrame = _phoneTextField.frame;
    phoneFrame.size.width = (DeviceWidth-60-40);
    phoneFrame.size.height = inputViewHeight;
    _phoneTextField.frame = phoneFrame;
    _inputPasswdView.frame = CGRectMake(30, startHeight+inputViewHeight, DeviceWidth-60, inputViewHeight);
    //子view布局
    CGRect pwdFrame = _passwdTextField.frame;
    pwdFrame.size.width = (DeviceWidth-60-40);
    pwdFrame.size.height = inputViewHeight;
    _passwdTextField.frame = pwdFrame;
    _passwdXianImageView.frame = CGRectMake(0, inputViewHeight-1, DeviceWidth-60,1);
    _forgetPasswdBtn.frame = CGRectMake(DeviceWidth-25-70, _inputPasswdView.frame.origin.y+_inputPasswdView.frame.size.height+4, 70, 28);
    CGFloat pading = kScaleFrom_iphone6_Desgin(25);
    _loginBtn.frame = CGRectMake(30, _forgetPasswdBtn.frame.origin.y+_forgetPasswdBtn.frame.size.height+pading, DeviceWidth-60, butonHeight);
    _loginBtn.layer.cornerRadius = 20.0f;
    _loginBtn.layer.masksToBounds = YES;
    
    _registerBtn.frame = CGRectMake(30, _loginBtn.frame.origin.y+_loginBtn.frame.size.height+10, DeviceWidth-60, butonHeight);
    _registerBtn.layer.borderColor = TabBarBjSelectColor.CGColor;
    _registerBtn.layer.borderWidth = 1.0f;
    _registerBtn.layer.cornerRadius = 20.0f;
    _registerBtn.layer.masksToBounds = YES;
    
    
    CGFloat bottompading = kScaleFrom_iphone6_Desgin(25);
    _thirdLoginView.frame = CGRectMake(40, totalHeight-80-bottompading, DeviceWidth-80, 80);
    //子view布局
    CGFloat thirdLoginWidth = 50;
    CGFloat thirdLoginHeight = 68;
    CGFloat thirdLoginPading = (_thirdLoginView.frame.size.width-50-50-50)/2.0;
    _wxBtn.frame = CGRectMake(0, 6, thirdLoginWidth, thirdLoginHeight);
    _qqBtn.frame = CGRectMake(thirdLoginWidth+thirdLoginPading, 6, thirdLoginWidth, thirdLoginHeight);
    _wbBtn.frame = CGRectMake(2*(thirdLoginWidth+thirdLoginPading), 6, thirdLoginWidth, thirdLoginHeight);
    
    
    CGFloat thirdpading = kScaleFrom_iphone6_Desgin(10);
    _thirdLoginUpView.frame = CGRectMake(30, totalHeight-bottompading-80-thirdpading-30, DeviceWidth-60, 30);
    CGFloat thirdLabelWidth = 146;
    CGFloat thirdXianWidth = (DeviceWidth-60-thirdLabelWidth)/2.0;
    _thirdUpLeftXian.frame = CGRectMake(0, 15, thirdXianWidth, 1);
    _thirdUpCenterLabel.frame = CGRectMake(_thirdUpLeftXian.frame.size.width, 5, thirdLabelWidth, 20);
    _thirdUpRightXian.frame =  CGRectMake(_thirdLoginUpView.frame.size.width-thirdXianWidth, 15, thirdXianWidth, 1);
    
    [_phoneTextField setTextFieldColor:[UIColor whiteColor] placeColor:[UIColor whiteColor] andStr:@"请输入手机号"];
    [_passwdTextField setTextFieldColor:[UIColor whiteColor] placeColor:[UIColor whiteColor] andStr:@"请输入密码"];
    
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];

    [_phoneTextField  becomeFirstResponder];
    [self loginRequest];
//    [self upLoadPhotoHandle];
//    self.navigationController.navigationBar.translucent = YES;
    [self.navigationController setNavigationBarHidden:YES animated:NO];
}
-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:YES];
}
-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    
//    self.navigationController.navigationBar.translucent = NO;
}

//-(void)leftItemClick:(id)sender
//{
//     self.navigationController.navigationBar.translucent = NO;
//    
//    
////    [self performSelector:@selector(delayHandle) withObject:nil afterDelay:0.1];
//    if (self.block) {
//        _block();
//    }
//    [self.navigationController dismissViewControllerAnimated:YES completion:^{}];
//}

-(void)delayHandle
{
    if (self.block) {
        _block();
    }
}

-(void)upLoadPhotoHandle
{
//    UIImage *image = [UIImage imageNamed:@"1380"];
//    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"4",@"type",@"1",@"test",@"opSendf",@"fileName", nil];
////    [[CDAPIManager sharedManager] request_upLoadPhoto_WithParams:dic image:image andIsSign:YES andBlock:^(id responseObj,NSError *error){
////        
////    
////    } progerssBlock:^(CGFloat progressValue) {
////    
////    
////    }];
//    
//    
//    [[CDAPIManager sharedManager] request_upLoadPhoto_WithParams:dic image:image andIsSign:YES andSuccessBlock:^(id responseObj,NSError *error){
//    
//    } failureBlock:^(NSError *error){
//    
//    } progerssBlock:^(CGFloat progressValue){
//        
//    }];
    
    [[CDAPIManager sharedManager] upLoadImageRequest];
    
}


- (IBAction)btnClickedHandle:(UIButton *)sender {
    switch (sender.tag) {
            
        case 99:
        {
            //返回
            [self.navigationController setNavigationBarHidden:NO animated:NO];
            [self.navigationController dismissViewControllerAnimated:YES completion:^{}];
            
        }
            break;
        case 100:
        {
            //立即注册
            RegisterViewController *regis = [[RegisterViewController alloc] initWithNibName:@"RegisterViewController" bundle:nil];
//            regis.addView = self.addView;
            [self.navigationController pushViewController:regis animated:YES];
        }
            break;
        case 101:
        {
            //登录
            [self loginHandle];
        
        }
            break;
        case 102:
        {
            //忘记密码
            ForgetPasswdViewController *passwd = [[ForgetPasswdViewController alloc] initWithNibName:@"ForgetPasswdViewController" bundle:nil];
//            passwd.addView = self.addView;
            [self.navigationController pushViewController:passwd animated:YES];
        }
            break;
        case 103:
        {
            //微信登录
            [self wxLoginHandle];
        }
        break;
        case 104:
        {
            //qq登录
            [self qqLoginHandle];
        }
            break;
        case 105:
        {
            //微博登录
            [self weiboLoginHandle];
        }
            break;
        
        default:
            break;
    }
    
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [self.view endEditing:YES];
    return YES;
}

-(void)loginHandle
{
    if (![NSString isMobileNumber:_phoneTextField.text]) {
        [MBProgressHUD showHUDAddedTo:self.view WithString:@"请输入正确的手机号"];
    }
    else if ([NSString isEmpty:_passwdTextField.text])
    {
        [MBProgressHUD showHUDAddedTo:self.view WithString:@"密码不能为空"];
    }
    else
    {
        [self loginRequest];
    }
}


- (void)loginRequest
{
    NSString *md5Str = [NSString MD5:@"123456"];
    NSDictionary *paramDic = [[NSDictionary alloc] initWithObjectsAndKeys:@"18616707730",@"phone",md5Str,@"pwd",@"1",@"test", nil];
    [[CDAPIManager sharedManager] request_AllHandle_WithParams:paramDic andApiTag:KLoginTag andIsSign:YES andBlock:^(id data, NSError *error,BOOL isSuccess){
        
        if (isSuccess) {
            
            Person *_person = [Person sharePerson];
            
            /*
             
             http://m.api.jjhw.com/user/gateway/login:
             {
             data =     {
             account =         {
             cash = 0;
             level = 0;
             score = 0;
             };
             "bind_info" =         (
             {
             appid = 1;
             uid = 573c88570c0536870a8b4567;
             }
             );
             headimg = "";
             id = 573c88570c0536870a8b4568;
             nickname = lzq;
             secret = 8abe521ea90056c86d54d74739bc499dYo7ltlSYGm;
             status = 0;
             token = 26d735de7a694f76a116fb63c1947a39I8RwWmL4x2;
             };
             msg = "";
             status = 0;
             }
             */
            
        }
        else
        {
            
        }
    }];
}

-(void)wxLoginHandle
{
    __block SSDKPlatformType type = SSDKPlatformTypeWechat;
    [ShareSDK getUserInfo:type conditional:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error){
        
        if (state!=2) {
            //1.得到授权凭证 2、是得到userinfo 的信息
            //                if (![ShareSDK hasAuthorized:type]) {
            if (state == 1) {//成功
                [ShareSDK authorize:type settings:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error){
                    NSDictionary *dic = user.rawData;
                    NSDictionary *params = [[NSDictionary alloc] initWithObjectsAndKeys:@"2",@"appid",[dic objectForKey:@"openid"],@"uid",[dic objectForKey:@"headimgurl"],@"headimg",[dic objectForKey:@"nickname"],@"nickname", nil];
                    [self thirdLoginMessage:params];
                    
                    
                }];
            }
            
            //                }
        }
        else
        {
            //state==2 表示失败
            NSDictionary *dic = [error userInfo];
            NSHTTPURLResponse *errorResponse = [dic objectForKey:@"com.alamofire.serialization.response.error.data"];
            
            NSString *tempStr = [[NSString alloc] initWithData:errorResponse encoding:NSUTF8StringEncoding];
            CDLog(@"授权错误：%@",tempStr);
            [self.view makeToast:tempStr duration:1.0 position:@"center"];
        }
        
        [ShareSDK cancelAuthorize:type];
        
    }];
}

-(void)qqLoginHandle
{
    __block SSDKPlatformType type = SSDKPlatformTypeQQ;
    
    [ShareSDK getUserInfo:type conditional:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error){
        
        if (state!=2) {
//            //1.得到授权凭证 2、是得到userinfo 的信息
//            if (![ShareSDK hasAuthorized:type]) {
//                
//            }
            [ShareSDK authorize:type settings:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error){
                NSDictionary *dic = user.rawData;
                NSDictionary *params = [[NSDictionary alloc] initWithObjectsAndKeys:@"4",@"appid",user.uid,@"uid",[dic objectForKey:@"figureurl_qq_2"],@"headimg",[dic objectForKey:@"nickname"],@"nickname", nil];
                [self thirdLoginMessage:params];
            }];
            
        }
        else
        {
            NSDictionary *dic = [error userInfo];
            NSHTTPURLResponse *errorResponse = [dic objectForKey:@"com.alamofire.serialization.response.error.data"];
            
            NSString *tempStr = [[NSString alloc] initWithData:errorResponse encoding:NSUTF8StringEncoding];
            CDLog(@"授权错误：%@",tempStr);
            [self.view makeToast:tempStr duration:1.0 position:@"center"];
        }
        
        [ShareSDK cancelAuthorize:type];
    }];
    
    
    
    
//    [SSEThirdPartyLoginHelper loginByPlatform:SSDKPlatformTypeQQ
//                                   onUserSync:^(SSDKUser *user, SSEUserAssociateHandler associateHandler) {
//                                       
//                                       //在此回调中可以将社交平台用户信息与自身用户系统进行绑定，最后使用一个唯一用户标识来关联此用户信息。
//                                       //在此示例中没有跟用户系统关联，则使用一个社交用户对应一个系统用户的方式。将社交用户的uid作为关联ID传入associateHandler。
//                                       associateHandler (user.uid, user, user);
//                                       NSLog(@"dd%@",user.rawData);
//                                       NSLog(@"dd%@",user.credential);
//                                       
//                                   }
//                                onLoginResult:^(SSDKResponseState state, SSEBaseUser *user, NSError *error) {
//                                    
//                                    if (state == SSDKResponseStateSuccess)
//                                    {
//                                        
//                                    }
//                                    
//                                }];
    
    
    [SSEThirdPartyLoginHelper loginByPlatform:SSDKPlatformTypeQQ
                                   onUserSync:^(SSDKUser *user, SSEUserAssociateHandler associateHandler) {
                                       
                                       
                                   }
                                onLoginResult:^(SSDKResponseState state, SSEBaseUser *user, NSError *error) {
                                    
                                    if (state == SSDKResponseStateSuccess)
                                    {
                                        
                                    }
                                    
                                }];
    
}
-(void)weiboLoginHandle
{
    __block SSDKPlatformType type = SSDKPlatformTypeSinaWeibo;
    
    [ShareSDK getUserInfo:type conditional:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error){
        
        if (state!=2) {
            //1.得到授权凭证 2、是得到userinfo 的信息
            //                if (![ShareSDK hasAuthorized:type]) {
            
            [ShareSDK authorize:type settings:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error){
                
                NSDictionary *dic = user.rawData;
                 NSDictionary *params = [[NSDictionary alloc] initWithObjectsAndKeys:@"4",@"appid",[dic objectForKey:@"id"],@"uid",[dic objectForKey:@"avatar_hd"],@"headimg",[dic objectForKey:@"name"],@"nickname", nil];
                
//                NSString *sexStr;//1 男2女
//                if ([[dic objectForKey:@"gender"] isEqualToString:@"m"]) {
//                    sexStr = @"1";
//                }
//                else
//                {
//                    sexStr = @"2";
//                }
//                
//                NSDictionary *dicParams =[NSDictionary dictionaryWithObjectsAndKeys:@"2",@"registType",@"",@"userPhone",@"",@"qqId",[dic objectForKey:@"id"],@"webId",@"",@"openId",[dic objectForKey:@"name"],@"nickname",sexStr,@"weixinSex",[dic objectForKey:@"avatar_hd"],@"headimgurl",@"",@"province",@"",@"city",@"",@"area",@"",@"tabsId", nil];
                
                [self thirdLoginMessage:params];
            }];
            //                }
        }
        else
        {
            //state==2 表示失败
            NSDictionary *dic = [error userInfo];
            NSHTTPURLResponse *errorResponse = [dic objectForKey:@"com.alamofire.serialization.response.error.data"];
            
            NSString *tempStr = [[NSString alloc] initWithData:errorResponse encoding:NSUTF8StringEncoding];
            CDLog(@"授权错误：%@",tempStr);
            [self.view makeToast:tempStr duration:1.0 position:@"center"];
        }
        
        [ShareSDK cancelAuthorize:type];
        
    }];
    
}
- (void)thirdLoginMessage:(NSDictionary *)dic {
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    NSMutableDictionary *mydic = [[NSMutableDictionary alloc] initWithDictionary:dic];
    [mydic setObject:@"1" forKey:@"test"];
    [[CDAPIManager sharedManager] request_AllHandle_WithParams:mydic andApiTag:KThirdLoginTag andIsSign:YES andBlock:^(id data, NSError *error,BOOL isSuccess){
        //第三方登录成功
        [MBProgressHUD hideHUDForView:self.view animated:YES];
        
        /*
         {
         data =     {
         account =         {
         cash = 0;
         level = 0;
         score = 0;
         };
         "bind_info" =         (
         {
         appid = 4;
         uid = DD797BEFB7AED74B5BA55B545B0F1023;
         }
         );
         headimg = "http://qzapp.qlogo.cn/qzapp/1105272407/DD797BEFB7AED74B5BA55B545B0F1023/100";
         id = 573d7f650c0536330b8b4567;
         nickname = "\U5c0fqiang";
         secret = 78b756dde3857838cae5dbf8f2b6e6b59z1tpcQq0j;
         status = 0;
         token = 67885a856b6fa1163d4d6903aa4e2ac2cVYzJEMuyQ;
         };
         msg = "";
         status = 0;
         }
         
         */
    
    }];
}



//-(void)viewWillAppear:(BOOL)animated
//{
//    [super viewWillAppear:YES];
//    self.navigationController.navigationBar.hidden = YES;
//}
//
//-(void)viewWillDisappear:(BOOL)animated
//{
//    [super viewWillDisappear:YES];
//    self.navigationController.navigationBar.hidden = YES;
//}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
